<template>
  <div>
    <el-dialog
      @close="cancel"
      title="查看证书"
      :visible.sync="open"
      width="700px"
      append-to-body
    >
      <el-form
        ref="elForm"
        :model="formData"
        :disabled="disabled"
        size="medium"
        label-width="150px"
      >
        <el-form-item label="证书类型" prop="certValue">
          <el-select
            v-model="formData.certValue"
            placeholder="请选择证书类型"
            clearable
            :style="{ width: '100%' }"
          >
            <el-option
              v-for="dict in dict.type.sys_cert_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item
          label="提交申请日"
          prop="applyDate"
          v-if="formData.certValue == 2"
        >
          <el-date-picker
            v-model="formData.applyDate"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            :style="{ width: '100%' }"
            placeholder="请选择提交申请日"
            clearable
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="证书名称" prop="certName">
          <el-input
            v-model="formData.certName"
            placeholder="请输入证书名称"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="证书编号/专利号" prop="num">
          <el-input
            v-model="formData.num"
            placeholder="请输入证书编号/专利号"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="证书/专利" prop="certImage">
          <imageUpload
            disabled
            :fileType="['png', 'jpg', 'jpeg', 'PDF', 'pdf']"
            v-model="formData.certImage"
          />
        </el-form-item>
        <el-form-item label="颁发部门" prop="dept">
          <el-input
            v-model="formData.dept"
            placeholder="请输入颁发部门"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="发证日期/ 公告时间" prop="publishDate">
          <el-date-picker
            v-model="formData.publishDate"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            :style="{ width: '100%' }"
            placeholder="请选择发证日期/ 公告时间"
            clearable
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="有效期" prop="limitDate">
          <el-date-picker
            v-model="formData.limitDate"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            :style="{ width: '100%' }"
            placeholder="请选择有效期"
            clearable
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="">
          <el-checkbox
            v-model="formData.isRemind"
            true-label="0"
            false-label="1"
            >设置到期提醒时间</el-checkbox
          >
          <el-select
            v-model="formData.remindType"
            placeholder="请选择提醒时间"
            :style="{ width: '100%' }"
          >
            <el-option label="1个月" value="1" />
            <el-option label="2个月" value="2" />
            <el-option label="3个月" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="发明人" prop="userName">
          <el-input
            v-model="formData.userName"
            placeholder="请输入发明人"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
        <el-form-item label="经办人" prop="operUserName">
          <el-input
            v-model="formData.operUserName"
            placeholder="请输入经办人"
            clearable
            :style="{ width: '100%' }"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  dicts: ["sys_cert_type"],

  props: {
    open: false,
    rowDetail: {},
    title: "",
    formData: {},
    disabled: false,
  },
  data() {
    return {};
  },
  methods: {
    cancel() {
      this.$emit("update:open");
      this.$emit("cancel");
    },
  },
};
</script>
